<template>
  <selectWithoutHttp
    v-model="selectWidget.options.banForms"
    :list-data="formList"
    :default-list="[]"
    :item-max-width="240"
    value-type="object"
    filterable
    multiple
    collapse-tags
    clearable
    placeholder="请选择表单"
    label-name="name"
    key-name="id"
    class="width240 mb" />
</template>

<script>
import { getLinkForm } from '@/api/process';
import selectWithoutHttp from '@/components/Common/selectWithoutHttp';

export default {
  components: { selectWithoutHttp },
  model: {
    prop: 'selectWidget',
    event: 'changeData'
  },
  props: {
    selectWidget: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      formList: []
    };
  },
  created() {
    this.getForm();
  },
  methods: {
    getForm() {
      getLinkForm().then(res => {
        if (res.code === 200) {
          this.formList = res.data;
        }
      });
    }
  }
};
</script>

<style lang="scss" scoped>
.mb {
  margin-bottom: 10px;
}
.width240 {
  width: 240px;
  &::v-deep {
    .el-input__inner {
      width: 240px;
    }
  }
}
</style>
